//
//  UINavigationController+PopGesture.h
//  BaseProject
//
//  Created by 小崔 on 2022/4/26.
//  本章内容摘自（ https://github.com/forkingdog ）属性名称做了修改

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface UINavigationController (PopGesture)

/// The gesture recognizer that actually handles interactive pop.
/// 实际处理交互式弹出的手势识别器。
@property (nonatomic, strong, readonly) UIPanGestureRecognizer *crj_fullscreenPopGestureRecognizer;

/// A view controller is able to control navigation bar's appearance by itself,
/// rather than a global way, checking "crj_prefersNavigationBarHidden" property.
/// Default to YES, disable it if you don't want so.
/// 视图控制器能够自己控制导航栏的外观，
/// 而不是全局方式，检查“crj_prefersNavigationBarHidden”属性。
/// 默认为YES，如果你不想这样做，禁用它。
@property (nonatomic, assign) BOOL crj_viewControllerBasedNavigationBarAppearanceEnabled;

@end

/// Allows any view controller to disable interactive pop gesture, which might
/// be necessary when the view controller itself handles pan gesture in some
/// cases.
/// 允许任何视图控制器禁用交互弹出手势，这可能在视图控制器本身处理一些平移手势时是必要的案例。
@interface UIViewController (PopGesture)

/// Whether the interactive pop gesture is disabled when contained in a navigation stack.
/// 当包含在导航中时，是否禁用交互式弹出手势堆栈，是否禁用滑动手势返回
@property (nonatomic, assign) BOOL crj_interactivePopDisabled;

/// Indicate this view controller prefers its navigation bar hidden or not,
/// checked when view controller based navigation bar's appearance is enabled.
/// Default to NO, bars are more likely to show.
/// 指示这个视图控制器希望导航栏隐藏或不隐藏，当基于视图控制器的导航栏的外观被启用。默认为NO，更可能显示条形图。
@property (nonatomic, assign) BOOL crj_prefersNavigationBarHidden;

/// Max allowed initial distance to left edge when you begin the interactive pop
/// gesture. 0 by default, which means it will ignore this limit.
/// 当你开始交互式弹出时，最大允许初始距离到左边缘姿态。默认为0，这意味着它将忽略这个限制。
@property (nonatomic, assign) CGFloat crj_interactivePopMaxAllowedInitialDistanceToLeftEdge;

@end

NS_ASSUME_NONNULL_END
